<!DOCTYPE html>
<html>

<head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta name="format-detection" content="telephone=no"/>
    <script type="text/javascript" src="js/sellerCore.js" charset="UTF-8"></script>
    <script src="js/jquery-3.2.1.min.js"></script>
    <script type="text/javascript">

    function myfun(){
        var cookie =  getCookie('UUID');
        $("#cookie").val(cookie);
        $.get("/upload",{"UUID":cookie},function(data,status){
                console.info(data);
                var json =  JSON.parse(data);

                if(json.status != "0"){
                   window.location.href='/web/login.html';
                }

                $("#content").val(json.result.content);
                $("#title").val(json.result.title);
                $("#message").val(json.result.notice);
			}
        );
    }

       $(document).ready(function() {
         myfun();
       });

        //读取cookies
        function getCookie(name){
            var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
            if(arr=document.cookie.match(reg))
            return unescape(arr[2]);
            else
            return null;
        }
    </script>
</head>

<body>
<form id="form1" enctype="multipart/form-data" method="POST" action="/upload">
    <input id="cookie" type="hidden" name="UUID" value="getCookie('UUID')" >

    主窗口背景图片:<input name="img" type="file" id="img_upload"  accept="image/*"/>
    <p id="img_area"></p>
    主窗口标题:<input type="text" name="title" id="title"></br>

    主窗口内容:</br>
    <textarea name="content" id="content" rows="10" cols="30"></textarea></br>

    通知公告:</br>
    <textarea name="message" rows="10" cols="30" id="message"></textarea></br>

    应用更新:<input name="apk" type="file" id="apk_upload"  />

    <input type="submit" value="提交">
</form>

</body>
</html>
